package com.evil.account.api;

import com.evil.account.config.FeignErrorDecoder;
import com.evil.account.pojo.entity.Template;
import com.evil.common.account.dto.template.DownloadUserTemplateReqDTO;
import com.evil.common.core.constant.ServiceNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 模板接口
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@FeignClient(name = ServiceNameConstant.ACCOUNT_SERVICE, configuration = {FeignErrorDecoder.class})
public interface RemoteTemplateService {


    /**
     * 通过模板类型获取导入模板
     *
     * @param downloadUserTemplateReqDTO d
     * @return url
     */
    @PostMapping("/download/user/template")
    String downloadUserTemplate(@Validated @RequestBody DownloadUserTemplateReqDTO downloadUserTemplateReqDTO);

    /**
     * 获取模板
     *
     * @param code code
     * @return Template
     */
    @PostMapping("/get/template")
    Template getTemplate(@RequestBody String code);
}